#!/usr/bin/env python
#-*- coding:utf-8 -*-

import os.path, logging, sys
from shorp.shorp import Shorp
from shorp.core.core import Parser
from shorp.core.interpreter import SimpleInterpreter, XmlInterpreter
from shorp.html.htmlinterpreter import HtmlInterpreter
from shorp.xml.interpreter import XmlInterpreter


VERSION = '20100318'
LOG_FILENAME = 'shorp.log'
logger = logging.getLogger('main')

DIR_PATH = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))

if __name__ == '__main__':    
    sys.path.append(DIR_PATH)
        
    logging.basicConfig(filename=LOG_FILENAME,lever=logging.DEBUG)
    
    i = XmlInterpreter('/home/ray/Develop/shorp/shorp.python/src/shorp/xml/sample.rule.sp')
    
    s = Shorp()
    #s.add('/home/ray/Develop/shorp/shorp.python/src/shorp/html/html.rule.sp')
    s.add('/home/ray/Develop/shorp/shorp.python/src/shorp/xml/sample.sp')
    s.interpreter = i
    print s.run()
    